package owl2vowl.parser.vowl.classes;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.semanticweb.owlapi.model.OWLObjectVisitor;
import org.semanticweb.owlapi.model.OWLSubClassOfAxiom;

import owl2vowl.model.data.VowlData;

public class GenericClassAxiomVisitor implements OWLObjectVisitor {
	private VowlData vowlData;
	private Logger logger = LogManager.getLogger(GenericClassAxiomVisitor.class);

	public GenericClassAxiomVisitor(VowlData vowlData) {
		this.vowlData = vowlData;
	}

	public void doDefault(Object object) {
		this.logger.info("Unsupported generic class axiom: " + object);
	}

	public void visit(OWLSubClassOfAxiom axiom) {
		if (!axiom.isGCI()) {
			this.logger.info("Generic axiom subclass is not anonym -> currently not supported: " + axiom);
		} else if (!axiom.getSuperClass().isAnonymous()) {
			axiom.getSubClass().accept(new OwlClassAxiomVisitor(this.vowlData, axiom.getSuperClass().asOWLClass()));
		}
	}
}